-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: added charm config #117
base: main
Are you sure you want to change the base?
Conversation
.env
Outdated
@@ -17,3 +17,4 @@ GOOGLE_DRIVE_FOLDER_ID=googlecreds | |||
COPYDOC_TEMPLATE_ID=googlecreds | |||
GOOGLE_PRIVATE_KEY=base64encodedprivatekey | |||
GOOGLE_PRIVATE_KEY_ID=privatekeyid | |||
FLASK_DEBUG=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is better be set in .env.local
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch
@@ -0,0 +1,9 @@ | |||
venv/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be .venv
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's created by default by the charm initialization, along with some charm src files, so I've left it as is
webapp/__init__.py
Outdated
@@ -38,7 +49,7 @@ def create_app(): | |||
init_cache(app) | |||
|
|||
# Initialize tasks | |||
init_tasks(app) | |||
# init_tasks(app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is not needed, can it be removed? Also, could you please explain how the tasks are going to be launched now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll remove it.
We're now using celery which will coordinate the background tasks between instances. I'm adding a section to the README
|
||
self.logger.info(f"Loading {self.repository_uri} from database") | ||
self.invalidate_cache() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain this change please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just a stylistic change because the else:
branch was redundant and I prefer putting the log first before any other process starts
# Create the locks for the site trees | ||
LOCKS = {} | ||
# Default delay between runs for scheduled tasks | ||
TASK_DELAY = int(os.getenv("TASK_DELAY", 5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase against main, as I added another task that has a different periodicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. Lemme do that and include the changes as we're now using celery for the periodic tasks.
I'll also update the readme
Done
QA
QA steps
Fixes
Screenshots
It could be helpful to provide some screenshots to aid in QAing the change.